<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet"
	type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet"
	type="text/css" />
<!-- <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.css"
	rel="stylesheet" type="text/css" /> -->
<link href="lib/region/css/city-picker.css" rel="stylesheet"
	type="text/css" />
<link href="lib/region/css/main.css" rel="stylesheet" type="text/css" />

  <link href="css/bootstrap.css" rel="stylesheet">
  <script src="js/jquery.js"></script> 
  <script src="js/bootstrap.js"></script> 
  <link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.2/summernote.css" rel="stylesheet" >
  <script src="js/summernote.js"></script>

<title>新增优惠券</title>
</head>
<body>
<div class="pd-20">
	<form action="<%=path%>/backstage/coupon-add" method="post" class="form form-horizontal" id="form-u_coupon-add">
		<input type="hidden" id="coupon_id" name="coupon_id" value='${u_coupon.coupon_id}' />
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">优惠券分类：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <span class="select-box"> 
                <select name="coupon_cate_id" class="select" datatype="*" nullmsg="不能为空">
					<c:forEach items="${match_classifys_list}" var="classifys">
						<option value="${classifys.item_value}" 
							<c:if test="${u_coupon.coupon_cate_id==classifys.item_value}">selected</c:if>>${classifys.display_name}
						</option>					
					</c:forEach>
				</select>
				</span>
        	</div>
		</div>
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">公司名称：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <input type="text" class="input-text" value="${u_coupon.corp_name}" placeholder="" id="" name="corp_name" datatype="*" nullmsg="不能为空">
        	</div>
		</div>
<%--         <div class="row cl">
			<label class="form-label col-2">公司位置：</label>
            <div class="formControls col-2">
                <input type="text" class="input-text" value="${u_coupon.corp_adress}" placeholder="" id="" name="corp_adress" datatype="*" nullmsg="不能为空">
        	</div>
		</div> --%>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">公司位置：</label>
			<div class="formControls col-xs-8 col-sm-5">
				<input id="city-picker3" class="form-control" readonly
					name="regioninfo" type="text" value="<c:if test="${u_coupon.province!=''}">${u_coupon.province}</c:if><c:if test="${u_coupon.city!=''}">/${u_coupon.city}</c:if><c:if test="${u_coupon.area!=''}">/${u_coupon.area}</c:if>" data-toggle="city-picker">
				<input type="text" class="input-text" value="${u_coupon.corp_adress}"
						placeholder="详细地址"  name="corp_adress" 
						nullmsg="不能为空">
			</div>
		</div>

        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">联系电话：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <input type="text" class="input-text" value="${u_coupon.corp_mobile}" placeholder="" id="" name="corp_mobile" datatype="*" nullmsg="不能为空">
        	</div>
		</div>
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">营业时间：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <input type="text" class="input-text" value="${u_coupon.business_hours}" placeholder="" id="" name="business_hours" datatype="*" nullmsg="不能为空">
        	</div>
		</div>
<%--         <div class="row cl">
			<label class="form-label col-2">优惠类型：</label>
            <div class="formControls col-2">
                <input type="text" class="input-text" value="${u_coupon.coupon_type}" placeholder="" id="" name="coupon_type" datatype="*" nullmsg="不能为空">
        	</div>
		</div> --%>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">优惠类型：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <span class="select-box"> 
	                <select name="coupon_type" class="select" datatype="*" nullmsg="不能为空">					
						<c:forEach items="${match_preferentias_list}" var="preferentias">
							<option value="${preferentias.item_value}" 
								<c:if test="${u_coupon.coupon_type==preferentias.item_value}">selected</c:if>>${preferentias.display_name}
							</option>					
						</c:forEach>
					</select>
				</span>
        	</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">投放范围：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <input type="text" class="input-text" value="${u_coupon.range}" placeholder="填写数字" id="" name="range" datatype="n" nullmsg="不能为空">
        	</div>
		</div>

      	<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">优惠券说明：</label>
			<input type="hidden" id="description" name ="description" >
			<div class="formControls col-xs-8 col-sm-5">
		 		<div id="summernote" class="input-text">${u_coupon.description}</div>
		 	</div>
		</div> 
        <div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">优惠金额</label> <label
					class="form-label col-xs-4 col-sm-5"><button
						onClick="add_new_charge();" class="btn btn-success radius"
						type="button">
						<i class="Hui-iconfont">&#xe632;</i> 添加
					</button></label> <label class="form-label col-xs-4 col-sm-3"></label>
			</div>

			<div class="row cl">
				<label class="form-label col-xs-2 col-sm-1">&nbsp;</label> <label
					class="col-xs-10 col-sm-8">
					<table id="charge" class="table">
						<thead>
							<tr>
								<th class="col-xs-1">#</th>
								<th class="col-xs-3">优惠金额</th>
								<th class="col-xs-1">使用条件</th>
								<th class="col-xs-2">数量（张）</th>
								<th class="col-xs-2">有效期至</th>
								<th class="col-xs-1"></th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${apiU_coupon}" var="coupon_info">
								<tr>
									<input type="hidden" id="coupon_id_list" name="coupon_id_list" value='${coupon_info.coupon_id}' />
									<td class='col-xs-1'></td>
									<td class='col-xs-3'><input type='text'
										class='form-control' style='min-width: 10px'
										name='coupon_amout'  nullmsg='不能为空并且不得超过50个字符'
										value="${coupon_info.coupon_amout}"></td>
									<td class='col-xs-1'><input type='text'
										class='form-control' style='min-width: 10px' name='use_limit1'
										value="${coupon_info.use_limit1}"></td>
									<td class='col-xs-2'><input type='text'
										class='form-control' style='min-width: 10px'
										name='coupon_count' datatype='n1-10' nullmsg='不能为空并且必须是整数'
										value="${coupon_info.coupon_count}"></td>
									<td class="col-xs-2">
										<input type="text"  name="end_time" value="${coupon_info.end_time}" class="input-text Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">	
									</td>	
										
									<td class='col-xs-1'><button
											class='btn btn-warning radius' type='button' onClick="coupon_disable(this)">
											<i class='fa fa-remove'>&#xe632;</i> 
											删除
										</button></td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</label>
			</div>
		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="u_coupon_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>


<script type="text/javascript" src="lib/layer/2.1/layer.js"></script>
<script type="text/javascript"
	src="lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript"
	src="lib/webuploader/0.1.5/webuploader.min.js"></script>
<script type="text/javascript"
	src="lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript"
	src="lib/ueditor/1.4.3/ueditor.all.min.js"></script>
<script type="text/javascript" src="lib/region/js/city-picker.data.js"></script>
<script type="text/javascript" src="lib/region/js/city-picker.js"></script>
<script type="text/javascript" src="lib/region/js/main.js"></script>
<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="js/u_coupon_list.js"></script>

<script type="text/javascript">

$(document).ready(function(){	
	$('#summernote').summernote({
		height: 150
	});
});

var web_path = "<%=path%>";
</script>
</body>
</html>

